<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/token.jsp"%>
<%@ include file="/common/user.jsp"%>
<%
	User me = userByUid(token.getUid());
	if (me == null || !Tools.getDesc(me.getJson("role"), "1").equals("3")) {
		Tools.encryptPrint(out, new Message(30031, "您无权限进行该操作"));
		return;
	}
	Integer deptId = me.getDeptId();
	if (deptId == null) {
		Tools.encryptPrint(out, new Message(30041, "不存在该科室"));
		return;
	}
	Integer memberUid = input.getInt("member_uid");
	if (memberUid.equals(token.getUid())) {
		Tools.encryptPrint(out, new Message(30031, "您不能删除自己"));
		return;
	}
	List<User> list = QBuilder.db("basedb").select().from("User").where(new Where("hospital=", hospital).and("deptId=", deptId).and("status=", STATUS_ENABLE).and("type=", USER_EMPLOYEE).and("id=", memberUid)).query().getResultObj();
	if (isEmpty(list)) {
		Tools.encryptPrint(out, new Message(30031, "本科室不存在该用户"));
		return;
	}
	User member = list.get(0);
	member.setStatus(STATUS_DISABLE);
	DBTools.db("basedb").modItem(member, member.getId());
	Tools.encryptPrint(out, msg);
%>
